package physicalobject;

public class Muscle extends Connector {
    
    private double myAmp;
    /**
     * Constructor for spring.
     * @param start the mass on one end of the spring
     * @param end the mass on the other end of the spring
     * @param length the rest length of the spring
     * @param kVal the "springiness" of the spring
     */
    public Muscle (final Mass start, final Mass end, final double length,
            final double kVal, final double amp) {
        super(start, end, length, kVal);
        myAmp = amp;
    }

    @Override
    public double getLength (double timeElapsed) {
        return myLength * (1 + myAmp * Math.sin(Math.toRadians(timeElapsed)));
    }
}
